<template>
	<view class="content">
		<image class="logo" src="/static/home.png"></image>
		<view class="text-area">
			<text class="title">{{state.title}}</text>
		</view>
		<view class="btn">
			<button type="default"  class="sysbut" @click="scan"><image class="sysicon" src="/static/sysicon.png"></image>请扫描二维码</button>
		</view>
	</view>
</template>

<script setup>
	import {
		reactive
	} from "vue";

	let state = reactive({
		title: ''
	})
	const scan = () => {
		uni.scanCode({
			success: (res) => {
				// uni.showLoading({
				// 	title: '加载中'
				// });
				uni.navigateTo({
					url: `/pages/details/index?clothingId=${encodeURIComponent(JSON.stringify(res.result))}`
				});
				// uni.hideLoading();
			}
		})
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 400rpx;
		width: 400rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}
	.sysbut{
		    display: flex;
		    justify-content: center;
		    align-items: center;
	}
	.sysicon {
		height: 40rpx;
		width: 40rpx;
		margin-right: 10rpx;

	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>